<template>
  <div>
    <el-button size="mini" type="primary" :icon="isView ? 'el-icon-more' : 'el-icon-edit'" @click="to" />
    <eForm ref="form" :sup-this="supThis" :is-add="false" :is-view="isView" />
  </div>
</template>
<script>
import eForm from './form'
export default {
  components: { eForm },
  props: {
    isView: {
      type: Boolean,
      required: true
    },
    data: {
      type: Object,
      required: true
    },
    supThis: {
      type: Object,
      required: true
    }
  },
  methods: {
    to() {
      const _this = this.$refs.form
      _this.form = {
        id: this.data.id,
        warehousename: this.data.warehousename,
        warehouselocation: this.data.warehouselocation,
        warehousedeptid: this.data.warehousedeptid,
        warehousedeptname: this.data.warehousedeptname,
        warehouselatitude: this.data.warehouselatitude,
        warehouselongitude: this.data.warehouselongitude,
        warehouseadministratorid: this.data.warehouseadministratorid,
        personname: this.data.personname,
        warehouseadministratorphone: this.data.warehouseadministratorphone,
        areacode: this.data.areacode
      }
      console.log(this.data.state)
      if (this.data.state === 1) {
        _this.form.state = '在用'
      } else if (this.data.state === 0) {
        _this.form.state = '停用'
      }
      <el-table-column prop='state' label='仓库状态'/>
      _this.dialog = true
    }
  }
}
</script>

<style scoped>
  div{
    display: inline-block;
    margin-right: 3px;
  }
</style>
